<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <link rel="stylesheet" href="/css/style0.css">
    <script src="/lib/layui/layui.js" charset="utf-8"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-btn-primary {
            border: 0px solid #C9C9C9;
            background-color: #fff;
            color: #555;
        }
        .layui-card-body{
            text-align: center;
        }
        .layui-card-body span{
            line-height: 30px;
        }
    </style>
</head>
<body>
<div class="layui-fluid" id="divvuehtml">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">数据统计</div>
                <div class="layui-card-body ">
                    <ul style="text-align: center" class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>教师总人数</h3>
                                <p>
                                    <cite>{{menuItems.jiaoshiCount}}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>实验员总人数</h3>
                                <p>
                                    <cite>{{menuItems.shiyanCount}}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>行政人员总人数</h3>
                                <p>
                                    <cite>{{menuItems.xingzhengCount}}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>教师兼行政总人数</h3>
                                <p>
                                    <cite>{{menuItems.jiaoshixingzhengCount}}</cite></p>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/vue.js"></script>
<script type="text/javascript" src="/js/xadmin.js"></script>
<script>
    var ve = new Vue({
        el: '#divvuehtml',//绑定vue渲染范围
        data: {
            menuItems: {},//初始化菜单资源list
        },
        created: function () {//vue在打开html前初始化创建函数
            this.inin();  //初始化菜单效果
        },
        mounted: function () {//初始化html完成后在进行操作

        },
        methods: {//调用函数
            inin: function () {
                $.get("/api/admin/users/getCount", {}, function (data) {
                    if (data.success) {
                        if (data.data != null) {
                            ve.menuItems = data.data;
                        }
                    } else {
                        layui.use(['layer'], function () {
                            var layer = layui.layer;
                            xadmin.alert(data.msg, {icon: 5})
                        })
                    }

                }, "json")
            }
        }
    })
</script>
</html>